<template>
	<view class="content-top" >
		<view class="search" >
				<input 
				v-model="queryWord"
				class="search-input" 
				focus placeholder="请输入搜索花卉关键词" />
		</view>
		<view class="search-btn" @click="clickSearch" >
			搜索
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				queryWord:"",
				pre:""
			}
		},
		methods: {
			// 点击搜索
			clickSearch(){
				if(this.queryWord == this.pre) return;
				this.$emit("search", this.queryWord);
				this.pre = this.queryWord;
			}
		}
	}
</script>

<style lang="less" scoped>
 .content-top {
	 display: flex;
	 align-items: center;
	justify-content: space-between;
	padding: 15rpx 40rpx;
	background-color: #ffffff;
	 .search{
		 height: 88rpx;
		 width:  74vw ;
		 display: flex;
		 justify-content: center;
		 align-items: center;
		 background-color: #ebecd3;
		 border-radius: 33rpx;
		 
		 
		 .search-input{
			 text-align: center;
		 }
		 
	
	 }
 
	.search-btn{
		width: 90rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 40rpx;
		font-weight: 600;
		color: #5ca45b;
	}
 }
</style>
